
(function($){

	$.fn.SorTable = function( data,store_id ){
		this.each(function() {
			$this = $(this)

			var header_ok = false
			$this.empty()
			for ( var r in data ){
				$this.append( row = $('<tr class="SorTable"></tr>') )				
				for (var c in data[r] ){
					if ( header_ok ){
						row.append( td = $('<td class="SorTable"></td>') )
						td.append( data[r][c] )
					}
					else{
						row.append( th = $('<th class="SorTable"></th>') )
						th.append( data[r][c] )
					}
				}
				header_ok = true
			}
		})
	}
}) (jQuery);
